package com.heima.search.controller.v1;


import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.search.dtos.UserSearchDto;
import com.heima.search.service.ArticleSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Gareth Cao
 * @date 2022/6/22 12:26
 */
@RestController
@RequestMapping("/api/v1/article/search")
public class ArticleSearchController {

    @Autowired
    private ArticleSearchService articleSearchService;
    /**
     * 文章搜索接口
     */
    @PostMapping("/search")
    public ResponseResult searchArticle(@RequestBody UserSearchDto userSearchDto) {
       return articleSearchService.searchArticle(userSearchDto);
    }

}
